import request from '@/utils/request'

// 查询人员列表
export function listTechnician(query) {
  return request({
    url: '/company/technician/list',
    method: 'get',
    params: query
  })
}

// 查询人员详细
export function getTechnician(id) {
  return request({
    url: '/company/technician/' + id,
    method: 'get'
  })
}

// 新增人员
export function addTechnician(data) {
  return request({
    url: '/company/technician/add',
    method: 'post',
    data: data
  })
}

// 修改人员
export function updateTechnician(data) {
  return request({
    url: '/company/technician/update',
    method: 'post',
    data: data
  })
}

// 删除人员
export function delTechnician(id) {
  return request({
    url: '/company/technician/delete/' + id,
    method: 'delete'
  })
}

//批量上架 下架
export function batchUpdateStatus(data) {
  return request({
    url: '/company/technician/batchUpdateStatus',
    method: 'post',
    data: data
  })
}

export function updateStatus(data) {
  return request({
    url: '/company/technician/updateStatus',
    method: 'post',
    data: data
  })
}

// 修改首页是否显示
export function upateIfIndex(id, ifIndex) {
  const data = {
    id,
    ifIndex
  }
  return request({
    url: '/company/technician/changeIfIndex',
    method: 'put',
    data: data
  })
}

export function uploadMainImg(data) {
  return request({
    url: '/company/technician/uploadMainImg',
    method: 'post',
    data: data
  })


}